package com.singbon.server.dao;
import com.singbon.server.pojo.SysUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
/**
 */
@Mapper
public interface SysUserDAO {
  @Select("SELECT * FROM sysuser WHERE operId = #{id}")
  SysUser selectById(Integer id);
  @Select("SELECT * FROM sysuser WHERE mobile = #{name,jdbcType=VARCHAR}")
  SysUser selectByName(@Param("name") String name);
  //@Insert("INSERT INTO sysuser(name,password) VALUES(#{name},#{password})")
  // void insert(SysUser user);
  /**
   * 根据operId获取出纳员
   */
  //public SysUser selectByOperId(Integer operId);
  /**
   * 获取登录信息
   */
  public SysUser login(@Param("companyName") String companyName, @Param("loginName") String loginName, @Param("loginPwd") String loginPwd);
  /**
   * 获取用户列表
   */
  // public List<SysUser> selecSysUsertList(@Param("companyId") Integer companyId);
  /**
   * 获取出纳员列表
   */
  public List<SysUser> selectCashierList(@Param("companyId") Integer companyId);
  /**
   * 根据读卡器查询绑定的出纳员
   * @param companyId Integer
   * @param deviceNum Integer
   * @return SysUser
   */
  SysUser selectSysUserByCardReader(@Param("companyId") Integer companyId, @Param("deviceNum") Integer deviceNum);
  SysUser selectSysUserAdmin(Integer companyId);
  void delete(Integer operId);
}
